package org.jackysoft.interceptor;

import java.lang.reflect.Method;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.jackysoft.annotations.ActionRequestMethod;
import org.jackysoft.annotations.MethodInceptor;
import org.jackysoft.entity.base.RootEntity;
import org.springframework.web.servlet.ModelAndView;

@MethodInceptor(method = ActionRequestMethod.update)
public class UpdateInterceptor extends AbstractInterceptor {

	@Override
	public void postHandle(HttpServletRequest request,
			HttpServletResponse response, Object handler,
			ModelAndView modelAndView) throws Exception {

		Method serviceUpdateBean = service.getClass().getMethod("update",
				RootEntity.class);

		serviceUpdateBean.invoke(service, bean);

	}

}
